package wsz.email.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import wsz.email.service.SendEmailService;
import wsz.util.CommonResult;

/**
 * 邮箱微服务
 * @author wsz
 * @date 2021/12/27 12:23
 **/
@RestController
@RequestMapping("email")
public class EmailController {

    @Autowired
    private SendEmailService sendEmailService;

    @GetMapping(value = "sendCode/{email}/{code}")
    public boolean sendCode(@PathVariable(name = "email") String email,
                                 @PathVariable(name = "code") String code) {
        return sendEmailService.sendEmail(email, code);
    }
}
